package cn.edu.tsinghua.cic.ccss.dto;

import java.util.Date;

import org.forten.core.dto.GeneralDto;

/**
 * 课程信息统计（课程总量、提供学时、选课人次、选课学时、实际选学人次、实际选学学时）
 * 
 * @author cj
 *
 */
public class CourseStatisticsDto implements GeneralDto{
	/**
	 * 
	 */
	private static final long serialVersionUID = -2281626034993073062L;
	
	private Date teachTime;// 上课时间
	private String courseName;// 课程名称
	private int credit;// 学时
	private long classChosenTotalNum; //选过课的总人数
	private int classChosenNum;// 已选课人数（实际选学人次）
	private int totalCredit; //选课学时
	private long actualCredit; //实际选学学时
	
	
	public Date getTeachTime() {
		return teachTime;
	}
	public void setTeachTime(Date teachTime) {
		this.teachTime = teachTime;
	}
	public String getCourseName() {
		return courseName;
	}
	public void setCourseName(String name) {
		this.courseName = name;
	}
	public int getCredit() {
		return credit;
	}
	public void setCredit(int credit) {
		this.credit = credit;
	}
	/**
	 * 获取选过课的总人数（包含退课人数）
	 * */
	public long getClassChosenTotalNum() {
		return classChosenTotalNum;
	}
	/**
	 * 设置选过课的总人数（包含退课人数）
	 * */
	public void setClassChosenTotalNum(long classChosenTotalNum) {
		this.classChosenTotalNum = classChosenTotalNum;
	}
	/**
	 * 获取已选课的总人数（不包含退课人数）
	 * */
	public int getClassChosenNum() {
		return classChosenNum;
	}
	/**
	 * 设置已选课的总人数（不包含退课人数）
	 * */
	public void setClassChosenNum(int classChosenNum) {
		this.classChosenNum = classChosenNum;
	}
	/**
	 * 获取选课学时（实际选学人数*学时）
	 * */
	public int getTotalCredit() {
		return totalCredit;
	}
	/**
	 * 设置选课学时（实际选学人数*学时）
	 * */
	public void setTotalCredit(int totalCredit) {
		this.totalCredit = totalCredit;
	}
	/**
	 * 获取实际选课学时（实际出勤人数*学时）
	 * */
	public long getActualCredit() {
		return actualCredit;
	}
	/**
	 * 设置选课学时（实际出勤人数*学时）
	 * */
	public void setActualCredit(long actualCredit) {
		this.actualCredit = actualCredit;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (actualCredit ^ (actualCredit >>> 32));
		result = prime * result + classChosenNum;
		result = prime * result
				+ (int) (classChosenTotalNum ^ (classChosenTotalNum >>> 32));
		result = prime * result
				+ ((courseName == null) ? 0 : courseName.hashCode());
		result = prime * result + credit;
		result = prime * result
				+ ((teachTime == null) ? 0 : teachTime.hashCode());
		result = prime * result + totalCredit;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CourseStatisticsDto other = (CourseStatisticsDto) obj;
		if (actualCredit != other.actualCredit)
			return false;
		if (classChosenNum != other.classChosenNum)
			return false;
		if (classChosenTotalNum != other.classChosenTotalNum)
			return false;
		if (courseName == null) {
			if (other.courseName != null)
				return false;
		} else if (!courseName.equals(other.courseName))
			return false;
		if (credit != other.credit)
			return false;
		if (teachTime == null) {
			if (other.teachTime != null)
				return false;
		} else if (!teachTime.equals(other.teachTime))
			return false;
		if (totalCredit != other.totalCredit)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "CourseStatisticsDto [teachTime=" + teachTime + ", courseName="
				+ courseName + ", credit=" + credit + ", classChosenTotalNum="
				+ classChosenTotalNum + ", classChosenNum=" + classChosenNum
				+ ", totalCredit=" + totalCredit + ", actualCredit="
				+ actualCredit + "]";
	}
	
	
	
	
}
